/******************************************************************************
** @file	WMIReaderTest.cpp
** @author  
**
** @date	Aug 1, 2010
**
** @desc	This test represents the option of the client: 
**			to obtain a connection to a local or remote machine with the attributes (usuary, password and remote pc). 
**          to obtain a list of processes running in the operating system 
**          to obtain a list of shares 
**          to obtain a list of diretorios and archives 
**          to obtain registries 
**			
**
******************************************************************************/

#include <iostream>
#include "../Unit--/unit--.h"
#include "../../WMIReader.h"

using namespace std;
using namespace unit_minus;

testSuite(POCSuite);

testCase (getSharesTest, POCSuite)
{
	cout << "---------- Start WMIReaderTest::getShareTest ----------" << endl;
	WMIReader reader;
	reader.initConexion();
	
	WMIResult<WShare> res;
    reader.getShares(res);
	cout << "\n------------------------------------------------------------------" << endl;
	cout << "|                         LIST OF SHARES                         |" << endl;
	cout << "------------------------------------------------------------------" << endl;
	res.showObjects();
	reader.closeConnection();
    cout << "---------- End WMIReaderTest::getShareTest ----------" << endl << endl;
    system("PAUSE");
}

testCase (getProccessesTest, POCSuite)
{
	cout << "---------- Start WMIReaderTest::getProcessesTest ----------" << endl;
	WMIReader reader;
	reader.initConexion();

	//WMIResult<WProcess>* res = reader.getProccesses();
	WMIResult<WProcess> res;
	//res = reader.getProccesses(res);
	reader.getProccesses(res);

	cout << "\n-----------------------------------------------------------------" << endl;
	cout << "|                         LIST OF PROCESS                         |" << endl;
	cout << "------------------------------------------------------------------" << endl;
	res.showObjects();
	reader.closeConnection();
    cout << "---------- End WMIReaderTest::getProcessesTest ----------" << endl << endl;
    system("PAUSE");
}

testCase (getLogicalDrives, POCSuite)
{
	cout << "-------- Start WMIReaderTest::getLogicalDrivesTest --------" << endl;
	WMIReader reader;
	reader.initConexion();

	WMIResult<WDisk> res;
	reader.getRootDirectories(res);

	cout << "\n------------------------------------------------------------------" << endl;
	cout << "|                      LIST OF LOGICAL DRIVES                     |" << endl;
	cout << "------------------------------------------------------------------" << endl;

	res.showObjects();
	reader.closeConnection();
    cout << "---------- End WMIReaderTest::getLogicalDrivesTest ----------" << endl << endl;
    system("PAUSE");
}

testCase (getFilesTest, POCSuite)
{
	cout << "-------- Start WMIReaderTest::getFilesTest --------" << endl;
	WMIReader reader;
	reader.initConexion();

	WMIResult<WFileDirectory> res; 
		reader.getFiles(L"e:\\",res);
	cout << "\n------------------------------------------------------------------" << endl;
	cout << "|                      LIST OF FILES/DIRECTORIES                   |" << endl;
	cout << "------------------------------------------------------------------" << endl;
	res.showObjects();
	reader.closeConnection();
    cout << "---------- End WMIReaderTest::getFilesTest ----------" << endl << endl;
    system("PAUSE");
}

testCase (getRegistryTest, POCSuite)
{
	cout << "-------- Start WMIReaderTest::getRegistryTest --------" << endl;
	WMIReader reader;
	reader.initConexion();
    WMIResult<WRegistry> res;
	reader.getRegistryChildren(EMPTY_PATH, res);
	cout << "\n------------------------------------------------------------------" << endl;
	cout << "|                      LIST OF REGISTRYS                   |" << endl;
	cout << "------------------------------------------------------------------" << endl;
	res.showObjects();
	reader.closeConnection();
    cout << "---------- End WMIReaderTest::getRegistryTest ----------" << endl << endl;
    system("PAUSE");
}

testCase (getStandardRegistryHivesTest, POCSuite)
{
	cout << "-------- Start WMIReaderTest::getStandardRegistryHivesTest --------" << endl;

	WMIReader reader;
	reader.initConexion();
	
	WMIResult<WRegistry> res;
	
	reader.getStandardRegistryHives(res);

	cout << "\n------------------------------------------------------------------" << endl;
	cout << "|                      LIST OF REGISTRYS HIVES                  |" << endl;
	cout << "------------------------------------------------------------------" << endl;
	res.showObjects();

	reader.closeConnection();
	cout << "-------- End WMIReaderTest::getStandardRegistryHivesTest --------" << endl;
	system("PAUSE");
}